<%--
  Created by IntelliJ IDEA.
  User: xzd
  Date: 2021/1/12
  Time: 14:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>显示所有用户页面</title>
</head>
<body>
<center>
    <table border="1">
        <tr>
            <td>编号：</td>
            <td>用户名：</td>
            <td>密码：</td>
            <td>邮箱:</td>
            <td>性别：</td>
            <td>权限角色：</td>
            <td>激活码：</td>
            <td>账号状态：</td>
            <td>生日：</td>
            <td colspan="2">操作</td>
        </tr>
        <c:forEach items="${users}" var="user" varStatus="vs">

        <tr>
            <td>${user.id}</td>
            <td>${user.username}</td>
            <td>${user.password}</td>
            <td>${user.email}</td>
            <td>${user.gender}</td>
            <td>${user.role}</td>
            <td>${user.active_code}</td>
            <td>${user.status}</td>
            <td>${user.birthday}</td>
<%--            <td><a href="<c:url context='${pageContext.request.contextPath}' value="/delete?id=${user.id}" />">删除数据</a> </td>--%>
<%--            <td><a href="<c:url context='${pageContext.request.contextPath}' value="/showUser?id=${user.id}" />">修改数据</a> </td>--%>

            <td><a href="${pageContext.request.contextPath}/deleteUser?id=${user.id}">删除</a> </td>
            <td><a href="${pageContext.request.contextPath}/showUserUpdateUI?id=${user.id}">修改</a> </td>
        </tr>
        <tr>
            <td colspan="20">当前总页数 </td>
        </tr>
        </c:forEach>
    </table>
    <button onclick="add()">添加一个用户</button>
</center>
</body>
<script>
    function add() {
        alert("add...");
        location.href="${pageContext.request.contextPath}/insertUser.jsp"
    }
</script>
</html>
